package cn.flying.cloud.base.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * @author: admin
 * @date: 2024年05月27日 11:20
 * @version: 1.0
 */
@Configuration
@ConfigurationProperties(prefix = "feign.okhttp")
public class FeignProperties {

    private Integer connectTimeout;

    private Integer writeTimeout;

    private Integer readTimeout;

    private Integer maxIdleConnections;

    private Integer keepAliveDuration;

    public Integer getConnectTimeout() {
        return connectTimeout == null ? 10 : connectTimeout;
    }

    public void setConnectTimeout(Integer connectTimeout) {
        this.connectTimeout = connectTimeout;
    }

    public Integer getWriteTimeout() {
        return writeTimeout == null ? 10 : writeTimeout;
    }

    public void setWriteTimeout(Integer writeTimeout) {
        this.writeTimeout = writeTimeout;
    }

    public Integer getReadTimeout() {
        return readTimeout == null ? 10 : readTimeout;
    }

    public void setReadTimeout(Integer readTimeout) {
        this.readTimeout = readTimeout;
    }

    public Integer getMaxIdleConnections() {
        return maxIdleConnections == null ? 10 : maxIdleConnections;
    }

    public void setMaxIdleConnections(Integer maxIdleConnections) {
        this.maxIdleConnections = maxIdleConnections;
    }

    public Integer getKeepAliveDuration() {
        return keepAliveDuration == null ? 5 : keepAliveDuration;
    }

    public void setKeepAliveDuration(Integer keepAliveDuration) {
        this.keepAliveDuration = keepAliveDuration;
    }
}
